]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
gdm/authPrompt: Fix key focus handling on choice list
authorMarco Trevisan (Treviño) <mail@3v1n0.net>
Fri, 22 Aug 2025 13:08:23 +0000 (15:08 +0200)
committerMarge Bot <marge-bot@gnome.org>
Wed, 24 Sep 2025 17:32:01 +0000 (17:32 +0000)
When a choice list widget is prompted in GDM we call updateSensitivity()
but this does not act on the currently visible authentication widget but
rather on the text entry all the times.

And this causes that when a choice list is shown we always set the key
focus to the (hidden) text entry.

This implies that when the list is finally shown, moving the arrow keys
leads makes the entry context menu to be shown instead of being able to
navigate through the entries.

So, make updateSensitivity use the currently visible authorization
widget instead and use it to control the sensitivity of the choice list

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3849>

js/gdm/authPrompt.js

index b9d35354ffdfd73c20e9beea9b5f90e71747d428..800e2f1851dc19b844c3fbcef56dae4c53ab7d40 100644 (file)
@@ -520,13 +520,13 @@ export const AuthPrompt = GObject.registerClass({
         this._authList.set({
             opacity: 0,
             visible: true,
-            reactive: false,
         });
+        this.updateSensitivity(false);
         this._authList.ease({
             opacity: 255,
             duration: MESSAGE_FADE_OUT_ANIMATION_TIME,
             transition: Clutter.AnimationMode.EASE_OUT_QUAD,
-            onComplete: () => (this._authList.reactive = true),
+            onComplete: () => this.updateSensitivity(true),
         });
     }
 
@@ -593,18 +593,25 @@ export const AuthPrompt = GObject.registerClass({
     }
 
     updateSensitivity(sensitive) {
-        if (this._entry.reactive === sensitive)
+        let authWidget;
+
+        if (this._authList.visible)
+            authWidget = this._authList;
+        else
+            authWidget = this._entry;
+
+        if (authWidget.reactive === sensitive)
             return;
 
-        this._entry.reactive = sensitive;
+        authWidget.reactive = sensitive;
 
         if (sensitive) {
-            this._entry.grab_key_focus();
+            authWidget.grab_key_focus();
         } else {
             this.grab_key_focus();
 
-            if (this._entry === this._passwordEntry)
-                this._entry.password_visible = false;
+            if (authWidget === this._passwordEntry)
+                authWidget.password_visible = false;
         }
     }